/* file nd_cliapp.h
 * nd-engine client applition 

 * neil duan
 * 2008-6
 */

#ifndef _ND_CLIAPP_H_
#define _ND_CLIAPP_H_

#include "nd_common/nd_common.h"
#include "nd_net/nd_netlib.h"
#include "nd_crypt/nd_crypt.h"
#include "nd_app/app_msgid.h"

#ifdef __cplusplus
#include "nd_appcpp/nd_object.h"
#include "nd_appcpp/nd_msgpacket.h"
#include "nd_appcpp/nd_connector.h"
#else 
#endif 

struct connect_config
{
	NDINT32 port ;
	NDINT8 protocol_name[64] ;
	NDINT8 host[256] ;
};

CPPAPI NDINT32 read_config(NDINT8 *file, struct connect_config *readcfg) ;

CPPAPI nd_handle get_connect_handle();

CPPAPI NDINT32 nd_cliapp_init(NDINT32 argc, NDINT8 *argv[]);

CPPAPI NDINT32 nd_cliapp_end(NDINT32 force);
CPPAPI NDINT32 start_encrypt(nd_handle connect_handle);

CPPAPI NDINT32 end_session(nd_handle connect_handle) ;

CPPAPI nd_handle create_connector() ;
CPPAPI void destroy_connect(nd_handle h_connect) ;
CPPAPI void install_msg(nd_handle connector) ;
CPPAPI struct connect_config * get_config_info() ;
#endif
